import React from 'react';
import { t } from '@lingui/macro';
import { observer } from 'mobx-react-lite';
import { FieldsGrid, TitleGrid } from './stores/definitions';

const BaseInfo = (props) => {
  const { form, order, isPreview } = props;
  return (
    <>
      <TitleGrid title={t`订单信息`} />
      <FieldsGrid
        formData={order}
        mode="view"
        fields={['crDate', 'ccOrder.orderType', 'ccOrder.subscribeName', 'ccOrder.subscribePhone']}
      />
      <TitleGrid title={t`乘坐信息`} />
      <FieldsGrid
        formData={form.formData}
        mode={isPreview ? 'view' : 'edit'}
        fields={[
          'passengerName', 'passengerPhone',
          'number', 'predictBeginDate',
          'flightNumber', 'language',
          'beginArea', 'beginName',
          'endArea', 'endName',
          'remarks',
        ]}
      />
    </>
  );
};

export default observer(BaseInfo);
